/*
 * @Author       : xiangmin
 * @File         : 省约号
 * @Date         : 2023-01-25 16:08:55
 * @LastEditors  : xiangmin
 * @LastEditTime : 2023-06-14 16:20:22
 */
import type { ObjectDirective } from 'vue'

const ellipsis: ObjectDirective<HTMLElement, number> = {
	mounted(element, binding) {
		const line = binding.value || 1
		element.style.overflow = 'hidden'
		element.style.display = '-webkit-box'
		element.style['-webkit-line-clamp'] = line
		element.style['-webkit-box-orient'] = 'vertical'
	}
}

export default ellipsis
